﻿<UserControl x:Class="WhiteFlow.DevTrackingTool.UI.Views.BackstageRecentTabView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:wfCommonCtl="clr-namespace:WhiteFlow.Wpf.Controls.Common;assembly=WhiteFlow.Wpf.Controls"
             mc:Ignorable="d"
             d:DesignHeight="397" d:DesignWidth="709">

    <Border Margin="20"
            Padding="10"
            BorderThickness="1"
            BorderBrush="#B2FFFFFF"
            Background="#66FFFFFF">

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50*" />
                <ColumnDefinition Width="1" />
                <ColumnDefinition Width="50*" />
            </Grid.ColumnDefinitions>

            <DockPanel LastChildFill="True" Margin="0,0,10,0">
                <Border BorderThickness="0,0,0,1" DockPanel.Dock="Top">
                    <Border.BorderBrush>
                        <ImageBrush ImageSource="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Images/Layout/dashed_border.jpg"
                                    TileMode="Tile"
                                    Viewport="0,0,4,1"
                                    ViewportUnits="Absolute"
                                    Stretch="Uniform" />
                    </Border.BorderBrush>

                    <TextBlock Text="Recent worksheets" 
                               Grid.Row="0"
                               FontSize="24" 
                               Foreground="{StaticResource ResourceKey=ContentsBgBrush}" 
                               FontFamily="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO" />
                </Border>

                <ScrollViewer Margin="0,10,0,5" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                    <ItemsControl ItemsSource="{Binding Path=RecentWorksheets}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <DockPanel Name="dp" LastChildFill="True" VerticalAlignment="Top">
                                    <Button DockPanel.Dock="Right"
                                            Command="{Binding Path=DataContext.QueryPinRecentCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
                                            CommandParameter="{Binding}"
                                            Foreground="{StaticResource ResourceKey=ContentsBgBrush}"
                                            Style="{StaticResource ResourceKey=HoverButtonStyle}">
                                        <wfCommonCtl:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Application/16x16/pin.png" />
                                    </Button>
                                    <Button Command="{Binding Path=DataContext.QueryOpenRecentCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
                                            CommandParameter="{Binding}"
                                            Foreground="{StaticResource ResourceKey=ContentsBgBrush}"
                                            Style="{StaticResource ResourceKey=HoverButtonStyle}">
                                        <StackPanel Orientation="Horizontal">
                                            <wfCommonCtl:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Images/NewWorksheet.png" />
                                            <Border>
                                                <StackPanel Orientation="Vertical"
                                                            VerticalAlignment="Center"
                                                            Margin="10,0,0,0">
                                                    <TextBlock Text="{Binding Path=FileName}" />
                                                    <TextBlock Text="{Binding Path=Path}" Foreground="DarkGray" />
                                                </StackPanel>
                                            </Border>
                                        </StackPanel>
                                    </Button>
                                </DockPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </DockPanel>

            <Border Grid.Column="1" BorderThickness="0,0,1,0">
                <Border.BorderBrush>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Offset="0.0" Color="Transparent" />
                        <GradientStop Offset="0.1" Color="#FFd7d7d7" />
                        <GradientStop Offset="0.9" Color="#FFd7d7d7" />
                        <GradientStop Offset="1.0" Color="Transparent" />
                    </LinearGradientBrush>
                </Border.BorderBrush>
            </Border>

            <DockPanel Grid.Column="2"
                       LastChildFill="True"
                       Margin="10,0,0,0">
                <Border BorderThickness="0,0,0,1" DockPanel.Dock="Top">
                    <Border.BorderBrush>
                        <ImageBrush ImageSource="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Images/Layout/dashed_border.jpg"
                                    TileMode="Tile"
                                    Viewport="0,0,4,1"
                                    ViewportUnits="Absolute"
                                    Stretch="Uniform" />
                    </Border.BorderBrush>

                    <TextBlock Text="Recent locations" 
                               Grid.Row="0"
                               FontSize="24" 
                               Foreground="{StaticResource ResourceKey=ContentsBgBrush}" 
                               FontFamily="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO" />
                </Border>

                <ScrollViewer Margin="0,10,0,5" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                    <ItemsControl ItemsSource="{Binding Path=RecentLocations}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <DockPanel LastChildFill="True" VerticalAlignment="Top">
                                    <Button DockPanel.Dock="Right"
                                            Foreground="{StaticResource ResourceKey=ContentsBgBrush}"
                                            Style="{StaticResource ResourceKey=HoverButtonStyle}">
                                        <wfCommonCtl:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Application/16x16/pin.png" />
                                    </Button>
                                    <Button Command="{Binding Path=DataContext.QueryOpenFromRecentLocationCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
                                            CommandParameter="{Binding Path=FullPath}"
                                            Foreground="{StaticResource ResourceKey=ContentsBgBrush}"
                                            Style="{StaticResource ResourceKey=HoverButtonStyle}">
                                        <StackPanel Orientation="Horizontal">
                                            <wfCommonCtl:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Application/32x32/folder_go.png" />
                                            <Border>
                                                <StackPanel Orientation="Vertical"
                                                            VerticalAlignment="Center"
                                                            Margin="10,0,0,0">
                                                    <TextBlock Text="{Binding Path=LastFolderInPath}" />
                                                    <TextBlock Text="{Binding Path=FullPath}" Foreground="DarkGray" />
                                                </StackPanel>
                                            </Border>
                                        </StackPanel>
                                    </Button>
                                </DockPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </DockPanel>
        </Grid>
    </Border>
    
</UserControl>